package br.com.firula.web;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;
import org.springframework.beans.factory.annotation.Autowired;

import br.com.firula.bo.SerieBO;
import br.com.firula.to.SerieTO;
import br.com.firula.to.BaseTO;
import br.com.firula.web.filter.Filtro;

public class SerieAction  extends GenericAction{

	private static final long serialVersionUID = -11105595311416759L;

	HttpServletResponse response;
	HttpServletRequest request;

	private SerieBO mgrSerie;

	@Autowired
    public void setSerieBO(SerieBO SerieBO) {
        this.mgrSerie = SerieBO;
    }

	public String list(){
		this.request = ServletActionContext.getRequest();
		this.response = ServletActionContext.getResponse();

		SerieTO serie = new SerieTO();
		Filtro serieFiltro = new Filtro();
		serieFiltro.setClazz(SerieTO.class);
		serieFiltro.setExample(serie);
		request.setAttribute("serieList", mgrSerie.getList(serieFiltro));
		return "listAdm";
	}

	@Override
	protected BaseTO getNew() {
		return null;
	}

}
